@model IEnumerable<InvoiceProject.Models.Quote>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th></th>
        <th>
            DateModified
        </th>
        <th>
            UserModified
        </th>
        <th>
            Customer
        </th>
        <th>
            Business
        </th>
        <th>
            TotalIncTax
        </th>
        <th>
            TotalTax
        </th>
        <th>
            InvoiceDate
        </th>
        <th>
            InvoiceItems
        </th>
        <th>
            QuoteDate
        </th>
        <th>
            ExpiryDate
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Details", "Details", new { id=item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.Id })
        </td>
        <td>
			@String.Format("{0:g}", item.DateModified)
        </td>
        <td>
			@item.UserModified
        </td>
        <td>
			@(item.Customer == null ? "None" : item.Customer.LastName)
        </td>
        <td>
			@(item.Business == null ? "None" : item.Business.Name)
        </td>
        <td>
			@String.Format("{0:F}", item.TotalIncTax)
        </td>
        <td>
			@String.Format("{0:F}", item.TotalTax)
        </td>
        <td>
			@String.Format("{0:g}", item.InvoiceDate)
        </td>
        <td>
			@(item.InvoiceItems == null ? "None" : item.InvoiceItems.Count.ToString())
        </td>
        <td>
			@String.Format("{0:g}", item.QuoteDate)
        </td>
        <td>
			@String.Format("{0:g}", item.ExpiryDate)
        </td>
    </tr>
}

</table>


